package zero.tech.wsnet.controller;

import java.util.HashMap;
import java.util.Map;

import zero.tech.core.data.SimpleUser;
import zero.tech.wsnet.net.WebClient;

public abstract class Controller {
	protected WebClient webClient;
	protected SimpleUser simpleUser;
	protected final Map<String,Object> attributes = new HashMap<String,Object>();
	
	
	public Controller(WebClient webClient, SimpleUser simpleUser) {
		super();
		if(webClient!=null) {
			this.webClient = webClient;
			this.webClient.setController(this);
		}
		this.simpleUser=simpleUser;
	}
	
	public WebClient getWebClient() {
		return webClient;
	}

	public void setWebClient(WebClient webClient) {
		this.webClient = webClient;
	}


	public Map<String, Object> getAttributes() {
		return attributes;
	}
	public int getId() {
		return this.simpleUser.getUid();
	}

	public SimpleUser getSimpleUser() {
		return simpleUser;
	}

	public void setSimpleUser(SimpleUser simpleUser) {
		this.simpleUser = simpleUser;
	}
}
